|
ARTeam Tutorial UnUPX of any UPXed Program in 15 Easy Steps |
| Information | A simple tecnique for unpacking any UPXed program, even if it has been modified. 10 steps easy to follow without bunch of theory. |
| Target | Atomic Time Synchnonizer |
| Available | http://www.lmhsoft.com/timesync/ |
| Tools | OllyDbg 1.10, CommandBar 3.0, PeiD, OllyDump, ImportREC |
| Protection | Program Compression |
| level | Beginners |
| Category | Unpacking Apps |
| Author | &8~) Shub-Nigurrath June 2004 |
|
1. Introduction
|
|
Hi all, today's problem is quite easy, what we want to learn is how to unpack any UPXed program with an easy to follow procedure that will work for any program that has been packed with UPX. UPX is one of the most simple executable packer, so don't expect the whole word to be so simple! ^__^ Just facts! I think for a newbie will be useful, but not only, also for other experienced people which are used to unpack UPX program only through automatic tools! The procedure is quite general and works also on modified UPXed programs. As a proof we will apply it to Atomic Time Synchronizer, which has been packed with UPX and then modified so as to not seem UPX. We will go up to unpacking it and further in cracking it, because the target once unpacked is very easy to defeat. All the available tutorials are filled with theory
about unpacking and so on, we don't want to bother you
doing this, the only thing we need is the OEP concept
(Original Entry Point). Given the original application,
just developed from its author, its entry point (the
address of the first instruction to be executed, stored
in the PE header) is what we call the EP. So, summing up, every packer needs to unpack the
wrapped program in memory, and this works in the
following way : A (small) chunk of code is decrypted and
placed on the right position in memory by the loader.
This process continues until the entire program is
unpacked. Next, the loader jumps to the entrypoint of
the original program (before it was packed). At this
moment, the program is fully unpacked and ready to be
dumped from memory to disk :) |
|
2. Target's
modifications
|
|
3.
15 golden steps
|
|
1. Launch the
process in Olly CTRL-F2
Picture above simply is a composition of OllyDbg screen captures, the jump at the OEP is at 5366EEB. The LoadLibrary was called form the CALL at 536EBE. 6. Go to the jump we identified and press F2 to set a breakpoint then press F9 (as in figure above). Note that you should also stop other times into LoadLibraryA, simply disable that breakpoint if you haven't done yet, it's useless now.7. Now you are in the situation of the picture above. Press F7 (or F8 it's the same) 8. Stop at the jmp destination address, the OEP! You should have something like below.
9. Dump the process
using OllyDump (for example). Note that OllyDump already
sets the OEP to the EIP value less the offset, but in
case use this simple formula
|
|
4. Conclusion
|
|
A BIG thanks goes to Peroquin and all ARTeam members and all the other from who I have learnt so much as well as the crew on exetools & other places.. This tute would not have been possible without their hard work and willingness to pass the knowledge on to others. I hope someone may find this tut useful Best Wishes (.|.)
|